package com.it.reggie.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import lombok.Data;
import java.io.Serializable;
import java.time.LocalDateTime;
//员工
@Data
public class Employee implements Serializable {

    private static final long serialVersionUID = 1L;

    private Long id;

    private String username;

    private String name;

    private String password;

    private String phone;

    private String sex;

    private String idNumber;
//身份证号//驼峰命名法//对应数据库的id_number//前提是在application.yml开启驼峰命名( map-underscore-to-camel-case: true)

    private Integer status;

    @TableField(fill = FieldFill.INSERT)//插入时填充字段//ctrl+点击FieldFill，看到DEFAULT是默认不处理
    private LocalDateTime createTime;//新增，执行insert语句时来维护这个字段的值

    @TableField(fill = FieldFill.INSERT_UPDATE)//插入和更新时填充字段
    private LocalDateTime updateTime;//插入和更新的时候，都需要重新设置这个字段的值

    @TableField(fill = FieldFill.INSERT)//插入时填充字段
    private Long createUser;

    @TableField(fill = FieldFill.INSERT_UPDATE)//插入和更新时填充字段
    private Long updateUser;

}
